package com.share.design.single;


/**
 * 单利设计模式 懒汉式
 * author:caifan
 * date:2020/2/4
 */
public class LazySingleton {

    private static volatile LazySingleton instance = null;
    private LazySingleton() {}

    public static synchronized LazySingleton getInstance() {
        if (null == instance) {
            instance = new LazySingleton();
        }
        return instance;
    }
}
